<template>
<!-- 品类组件 -->
  <div class="goodslist">
    <ul>
      <li v-for="item in goodsList" :key="item.id" @click="GoProductFn(item.id)">
        <img v-lazy="item.list_pic_url" alt="" width="100%" />
        <p>{{ item.name }}</p>
        <section>{{ item.retail_price | filterPrice }}</section>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["goodsList"],
  data() {
    return {
    };
  },
  methods:{
    //跳转到产品详情
   GoProductFn(id){
    this.$router.push(`/product/${id}`) 
   }
  }
};
</script>
 
<style lang = "less" scoped>
.goodslist {
  background-color: #fff;
  ul {
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    padding-bottom: 50px;
    li {
      width: 50%;
      text-align: center;
      box-sizing: border-box;
      p {
        margin: 0 10px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        font-size: 14px;
      }
      section {
        color: darkred;
        margin-top: 5px;
      }
    }
  }
}
</style>